package com.jzo2o.customer.controller.worker;


import com.jzo2o.customer.enums.BankAccontTypeEnum;
import com.jzo2o.customer.model.dto.response.BankAccountResDTO;
import com.jzo2o.customer.service.IBankAccountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 银行账户 前端控制器
 * </p>
 *
 * @author xuchun
 * @since 2024-08-11
 */
@Api(tags = "服务端 - 银行账户相关接口")
@RestController("workerBankAccountController")
@RequestMapping("/worker/bank-account")
public class BankAccountController {

    @Resource
    private IBankAccountService bankAccountService;

    @ApiOperation("新增或更新银行账号信息接口")
    @PostMapping
    public void saveBankAccount(@RequestBody BankAccountResDTO dto) {
        bankAccountService.saveBankAccount(dto);
    }


    @ApiOperation("新增或更新银行账号信息接口")
    @GetMapping("/currentUserBankAccount")
    public BankAccountResDTO currentUserBankAccount() {
        return bankAccountService.currentUserBankAccount(BankAccontTypeEnum.WORKER.getStatus());
    }



}
